
import os
import sys
import glob
from netorchestr.common.util import DataAnalysis


# 从脚本传入参数中获取
if len(sys.argv) > 1:
    logs_dir = sys.argv[1]
else:
    logs_dir = "SfcdSagin_Yilong15Pro_20251105082809488_0"

if not os.path.exists(logs_dir):
    print(f"ERROR: {logs_dir} not exists")
    sys.exit(1)

target_dir = os.path.join(os.path.dirname(__file__), logs_dir)
csv_files = glob.glob(os.path.join(target_dir, "nfvo_deploy_*.csv"))

for csv_file in csv_files:
    DataAnalysis.getResult(csv_file)
